package com.example.asyntaskdemo;

import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class ImageService implements WebConnect  {

	public static Bitmap getImage(String path) throws Throwable {
		Bitmap bitmap;
		URL url = new URL(path);
		HttpURLConnection conn = (HttpURLConnection) url.openConnection();
		conn.setReadTimeout(5000);
		conn.setRequestMethod("GET");
		InputStream is = conn.getInputStream();
		bitmap = BitmapFactory.decodeStream(is);
		return bitmap;
	}
}
